When programmers develop code, there is oftentimes a need to work with the code such as refactoring, for example, to move code sections to change the structure without altering the code behavior, find certain properties about the code (variable declarations), or to verify if While statements lack a following compound statement, and so on. These types of question are easy to ask but current tools are not sufficiently robust to provide the answers.
Current technology offered by source code editing systems use only rudimentary searching capabilities, usually confined to using simple text-based searches or searches using regular expressions. Searching is based on the unstructured text representation of the source code. For example, searching can be accomplished through regular expression matching.
The view that all tools provide is that the source code is simply a sequence of characters in a text editor. The code does not have any structure beyond the sequence of characters. This unstructured content makes it unsuitable for doing any sort of structured search because there is no structure upon which to base the search.
Text searches can be made against source code in much the same way as for searching for a particular word in a text document. The user can search for the occurrence of a particular word, and the system implementing the search (e.g., a text processor) will present all the matching places in the document. In some cases the searching facility is a little more advanced, allowing regular expressions to be used which can express things such as “Show me all instances in the document where 3 “w” occurs followed by a dot followed by any number of characters”, etc. To these systems the searching occurs over a stream of otherwise unstructured text. However, the problem with this approach is that the system does not understand the problem domain that the text describes.